﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Furion.DatabaseAccessor;
using Microsoft.EntityFrameworkCore;
using Microsoft.EntityFrameworkCore.Metadata.Builders;

namespace Bdcs.Core.Entity
{
    /// <summary>
    /// CRRouteInfo_M数据模型对象
    /// </summary>
    [Serializable]
    public partial class CRRouteInfo_MMod  : IEntity, IEntityTypeBuilder<CRRouteInfo_MMod>
    {
        /// <summary>
        /// 初始化CRRouteInfo_M数据模型对象
        /// </summary>
        public CRRouteInfo_MMod()
        {
            
        }
        /// <summary>
        /// 初始化CRRouteInfo_M数据模型对象并给在SQL中不能为空的字段赋值
        /// </summary>
        /// <param name="routeID">RouteID</param>
        /// <param name="routeName">RouteName</param>
        /// <param name="totalLength">TotalLength</param>
        /// <param name="companyID">CompanyID</param>
        /// <param name="routeWidth">RouteWidth</param>
        /// <param name="routeType">RouteType</param>
        public CRRouteInfo_MMod(string routeID,string routeName,decimal totalLength,string companyID,decimal routeWidth,int routeType)
        {
            //给RouteID字段赋值
            this.RouteID = routeID;
            //给RouteName字段赋值
            this.RouteName = routeName;
            //给TotalLength字段赋值
            this.TotalLength = totalLength;
            //给CompanyID字段赋值
            this.CompanyID = companyID;
            //给RouteWidth字段赋值
            this.RouteWidth = routeWidth;
            //给RouteType字段赋值
            this.RouteType = routeType;
        }
        /// <summary>
        /// 初始化CRRouteInfo_M数据模型对象并给所有字段赋值
        /// </summary>
        /// <param name="routeID">RouteID</param>
        /// <param name="routeName">RouteName</param>
        /// <param name="district">District</param>
        /// <param name="totalLength">TotalLength</param>
        /// <param name="lastModifiedTime">LastModifiedTime</param>
        /// <param name="maker">Maker</param>
        /// <param name="remark">Remark</param>
        /// <param name="companyID">CompanyID</param>
        /// <param name="city">City</param>
        /// <param name="routeWidth">RouteWidth</param>
        /// <param name="routeType">RouteType</param>
        /// <param name="deptID">DeptID</param>
        /// <param name="corpID">CorpID</param>
        public CRRouteInfo_MMod(string routeID,string routeName,string district,decimal totalLength,DateTime? lastModifiedTime,string maker,string remark,string companyID,string city,decimal routeWidth,int routeType,string deptID,string corpID)
        {
            //给RouteID字段赋值
            this.RouteID = routeID;
            //给RouteName字段赋值
            this.RouteName = routeName;
            //给District字段赋值
            this.District = district;
            //给TotalLength字段赋值
            this.TotalLength = totalLength;
            //给LastModifiedTime字段赋值
            this.LastModifiedTime = lastModifiedTime;
            //给Maker字段赋值
            this.Maker = maker;
            //给Remark字段赋值
            this.Remark = remark;
            //给CompanyID字段赋值
            this.CompanyID = companyID;
            //给City字段赋值
            this.City = city;
            //给RouteWidth字段赋值
            this.RouteWidth = routeWidth;
            //给RouteType字段赋值
            this.RouteType = routeType;
            //给DeptID字段赋值
            this.DeptID = deptID;
            //给CorpID字段赋值
            this.CorpID = corpID;
        }
        
		//属性存储数据的变量
        private string _routeID;
        private string _routeName;
        private string _district;
        private decimal _totalLength;
        private DateTime? _lastModifiedTime;
        private string _maker;
        private string _remark;
        private string _companyID;
        private string _city;
        private decimal _routeWidth;
        private int _routeType;
        private string _deptID;
        private string _corpID;
        
        /// <summary>
        /// 围栏编号
        /// </summary>
        public string RouteID
        {
            get { return this._routeID; }
            set { this._routeID = value; }
        }
        /// <summary>
        /// 围栏名称
        /// </summary>
        public string RouteName
        {
            get { return this._routeName; }
            set { this._routeName = value; }
        }
        /// <summary>
        /// District
        /// </summary>
        public string District
        {
            get { return this._district; }
            set { this._district = value; }
        }
        /// <summary>
        /// TotalLength
        /// </summary>
        public decimal TotalLength
        {
            get { return this._totalLength; }
            set { this._totalLength = value; }
        }
        /// <summary>
        /// LastModifiedTime
        /// </summary>
        public DateTime? LastModifiedTime
        {
            get { return this._lastModifiedTime; }
            set { this._lastModifiedTime = value; }
        }
        /// <summary>
        /// Maker
        /// </summary>
        public string Maker
        {
            get { return this._maker; }
            set { this._maker = value; }
        }
        /// <summary>
        /// Remark
        /// </summary>
        public string Remark
        {
            get { return this._remark; }
            set { this._remark = value; }
        }
        /// <summary>
        /// 所属公司id
        /// </summary>
        public string CompanyID
        {
            get { return this._companyID; }
            set { this._companyID = value; }
        }
        /// <summary>
        /// City
        /// </summary>
        public string City
        {
            get { return this._city; }
            set { this._city = value; }
        }
        /// <summary>
        /// RouteWidth
        /// </summary>
        public decimal RouteWidth
        {
            get { return this._routeWidth; }
            set { this._routeWidth = value; }
        }
        /// <summary>
        /// RouteType
        /// </summary>
        public int RouteType
        {
            get { return this._routeType; }
            set { this._routeType = value; }
        }
        /// <summary>
        /// DeptID
        /// </summary>
        public string DeptID
        {
            get { return this._deptID; }
            set { this._deptID = value; }
        }
        /// <summary>
        /// CorpID
        /// </summary>
        public string CorpID
        {
            get { return this._corpID; }
            set { this._corpID = value; }
        }

        public void Configure(EntityTypeBuilder<CRRouteInfo_MMod> entityBuilder, DbContext dbContext, Type dbContextLocator)
        {
            {
                entityBuilder.ToTable("CRRouteInfo_M");
                entityBuilder.HasComment("围栏管理");
                entityBuilder.HasKey(e => e.RouteID);
            }
        }
        

        /// <summary>
        /// 对比两个CRRouteInfo_M数据模型对象是否一致
        /// </summary>
        /// <param name="obj">要进行比对的CRRouteInfo_M数据模型对象</param>
        /// <returns>返回是否一致，为true一致，为false不一致</returns>
        public override bool Equals(object obj)
        {
            //判断传入对象是否为null
            if (obj == null) return false;
            //将传入对象转换成CRRouteInfo_M数据模型对象
            CRRouteInfo_MMod cRRouteInfo_MMod = obj as CRRouteInfo_MMod;
            //判断是否转换成功
            if (cRRouteInfo_MMod == null) return false;
            //进行匹配属性的值
            return
                //判断RouteID是否一致
                this.RouteID == cRRouteInfo_MMod.RouteID &&
                //判断RouteName是否一致
                this.RouteName == cRRouteInfo_MMod.RouteName &&
                //判断District是否一致
                this.District == cRRouteInfo_MMod.District &&
                //判断TotalLength是否一致
                this.TotalLength == cRRouteInfo_MMod.TotalLength &&
                //判断LastModifiedTime是否一致
                this.LastModifiedTime == cRRouteInfo_MMod.LastModifiedTime &&
                //判断Maker是否一致
                this.Maker == cRRouteInfo_MMod.Maker &&
                //判断Remark是否一致
                this.Remark == cRRouteInfo_MMod.Remark &&
                //判断CompanyID是否一致
                this.CompanyID == cRRouteInfo_MMod.CompanyID &&
                //判断City是否一致
                this.City == cRRouteInfo_MMod.City &&
                //判断RouteWidth是否一致
                this.RouteWidth == cRRouteInfo_MMod.RouteWidth &&
                //判断RouteType是否一致
                this.RouteType == cRRouteInfo_MMod.RouteType &&
                //判断DeptID是否一致
                this.DeptID == cRRouteInfo_MMod.DeptID &&
                //判断CorpID是否一致
                this.CorpID == cRRouteInfo_MMod.CorpID;
        }
        /// <summary>
        /// 将当前CRRouteInfo_M数据模型对象转换成哈希码
        /// </summary>
        /// <returns>哈希值</returns>
        public override int GetHashCode()
        {
            //将CRRouteInfo_M数据模型对象的属性进行按位异或运算处理得到哈希码并返回
            return
                //将RouteID进行按位异或运算处理
                (this.RouteID == null ? 2147483647 : this.RouteID.GetHashCode()) ^
                //将RouteName进行按位异或运算处理
                (this.RouteName == null ? 2147483647 : this.RouteName.GetHashCode()) ^
                //将District进行按位异或运算处理
                (this.District == null ? 2147483647 : this.District.GetHashCode()) ^
                //将TotalLength进行按位异或运算处理
                this.TotalLength.GetHashCode() ^
                //将LastModifiedTime进行按位异或运算处理
                (this.LastModifiedTime == null ? 2147483647 : this.LastModifiedTime.GetHashCode()) ^
                //将Maker进行按位异或运算处理
                (this.Maker == null ? 2147483647 : this.Maker.GetHashCode()) ^
                //将Remark进行按位异或运算处理
                (this.Remark == null ? 2147483647 : this.Remark.GetHashCode()) ^
                //将CompanyID进行按位异或运算处理
                (this.CompanyID == null ? 2147483647 : this.CompanyID.GetHashCode()) ^
                //将City进行按位异或运算处理
                (this.City == null ? 2147483647 : this.City.GetHashCode()) ^
                //将RouteWidth进行按位异或运算处理
                this.RouteWidth.GetHashCode() ^
                //将RouteType进行按位异或运算处理
                this.RouteType.GetHashCode() ^
                //将DeptID进行按位异或运算处理
                (this.DeptID == null ? 2147483647 : this.DeptID.GetHashCode()) ^
                //将CorpID进行按位异或运算处理
                (this.CorpID == null ? 2147483647 : this.CorpID.GetHashCode());
        }
        /// <summary>
        /// 将当前CRRouteInfo_M数据模型对象转换成字符串副本【仅显示在SQL中不能为空的列】
        /// </summary>
        /// <returns>字符串形式副本</returns>
        public override string ToString()
        {
            //将当前CRRouteInfo_M数据模型对象转换成字符串副本
            return
                "[" +
                //将RouteID转换成字符串
                this.RouteID + "," +
                //将RouteName转换成字符串
                this.RouteName + "," +
                //将TotalLength转换成字符串
                this.TotalLength + "," +
                //将CompanyID转换成字符串
                this.CompanyID + "," +
                //将RouteWidth转换成字符串
                this.RouteWidth + "," +
                //将RouteType转换成字符串
                this.RouteType +
                "]";
        }
    }
}
